package com.bq.server.core.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bq.server.base.BaseEntity;
import com.bq.server.tree.Tree;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 部门表
 *
 * @author shchen
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "department")
public class Department extends BaseEntity<Department> implements Tree<Long> {

    /**
     * 父级id,无父部门:0
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 部门名称
     */
    @TableField(value = "dept_name")
    private String deptName;

    /**
     * 是否隐藏部门，1:表示隐藏，0:表示显示
     */
    @TableField(value = "dept_hiding")
    private Byte deptHiding;

    /**
     * 统一机构编码
     */
    @TableField(value = "dept_code")
    private Long deptCode;

    /**
     * 当前部门在父部门下的所有子部门中的排序值
     */
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 机构级别
     */
    @TableField(value = "`level`")
    private Byte level;

    @Override
    public String getName() {
        return this.deptName;
    }
}